<?php
    function formataReal($number, $fractional=false) {
        $valor = number_format($number, 2, ',', '.');
        return $valor;
    }
?>